import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;


public class CalendarTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		double a = 10000000.0;//首都圏の1日の鉄道利用者
		double b = 30.0;//1日の鉄道利用のなかで、知り合いであればわかるほど接近する人の数
		double c = 1.0 - b/a;
		double d = Math.pow(c ,50.0);
		double e =  Math.pow(d ,700.0);
		System.out.println("1日の間に特定の一人の人にあわない確率: " + c);
		System.out.println("1日の間に特定の50人(同級生)の誰にもあわない確率: " + d);
		System.out.println("700日(在学中)の間に特定の50人の誰にもあわない確率: " + e);
		System.out.println("在学中に同級生の誰かに偶然あう確率: " + ((1.0 - e)*100) + "％");

















		// TODO 自動生成されたメソッド・スタブ
		Calendar calendar = new GregorianCalendar();
		 Date trialTime = new Date();
		 calendar.setTime(trialTime);

		 // print out a bunch of interesting things
		 System.out.println("ERA: " + calendar.get(Calendar.ERA));
		 System.out.println("YEAR: " + calendar.get(Calendar.YEAR));
		 System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
		 System.out.println("WEEK_OF_YEAR: " + calendar.get(Calendar.WEEK_OF_YEAR));
		 System.out.println("WEEK_OF_MONTH: " + calendar.get(Calendar.WEEK_OF_MONTH));
		 System.out.println("DATE: " + calendar.get(Calendar.DATE));
		 System.out.println("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
		 System.out.println("DAY_OF_YEAR: " + calendar.get(Calendar.DAY_OF_YEAR));
		 System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
		 System.out.println("DAY_OF_WEEK_IN_MONTH: "
		                    + calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
		 System.out.println("AM_PM: " + calendar.get(Calendar.AM_PM));
		 System.out.println("HOUR: " + calendar.get(Calendar.HOUR));
		 System.out.println("HOUR_OF_DAY: " + calendar.get(Calendar.HOUR_OF_DAY));
		 System.out.println("MINUTE: " + calendar.get(Calendar.MINUTE));
		 System.out.println("SECOND: " + calendar.get(Calendar.SECOND));
		 System.out.println("MILLISECOND: " + calendar.get(Calendar.MILLISECOND));

			StringBuffer sb = new StringBuffer();
			sb.append(calendar.get(Calendar.YEAR) + ".");
			int month = calendar.get(Calendar.MONTH) + 1;
			sb.append(month + ".");
			sb.append(calendar.get(Calendar.DATE) + ":");
			sb.append(calendar.get(Calendar.HOUR_OF_DAY) + ".");
			sb.append(calendar.get(Calendar.MINUTE) + ".");
			sb.append(calendar.get(Calendar.SECOND) + ".");
			sb.append(calendar.get(Calendar.MILLISECOND));
			System.out.println(sb.toString());
	}

}
